package com.ollobot.authorization.common;

/**
 * 业务异常编码常量类
 * 用于定义不同的业务异常编码
 */
public class ErrorCode {
    
    // 通用错误码 (1000-1999)
    public static final int INVALID_PARAMETER = 1001;
    public static final int MISSING_PARAMETER = 1002;
    public static final int INVALID_REQUEST = 1003;
    public static final int SYSTEM_ERROR = 1004;
    
    // 认证相关错误码 (2000-2999)
    public static final int INVALID_CREDENTIALS = 2001;
    public static final int ACCOUNT_LOCKED = 2002;
    public static final int ACCOUNT_DISABLED = 2003;
    public static final int PASSWORD_EXPIRED = 2004;
    public static final int AUTHENTICATION_FAILED = 2005;
    
    // 邮箱验证相关错误码 (3000-3099)
    public static final int EMAIL_SEND_FAILED = 3001;
    public static final int VERIFICATION_CODE_INVALID = 3002;
    public static final int VERIFICATION_CODE_EXPIRED = 3003;
    public static final int VERIFICATION_CODE_USED = 3004;
    public static final int EMAIL_ALREADY_VERIFIED = 3005;
    public static final int EMAIL_NOT_FOUND = 3006;
    public static final int RATE_LIMIT_EXCEEDED = 3007;
    public static final int EMAIL_INVALID = 3008;
    public static final int EMAIL_NOT_REACHABLE = 3009;
    public static final int SMTP_ERROR = 3010;
    public static final int EMAIL_AUTHENTICATION_FAILED = 3011;
    public static final int EMAIL_NETWORK_ERROR = 3012;
    public static final int EMAIL_TEMPLATE_ERROR = 3013;
    
    // OAuth2相关错误码 (4000-4099)
    public static final int OAUTH2_TOKEN_INVALID = 4001;
    public static final int OAUTH2_PROVIDER_ERROR = 4002;
    public static final int GOOGLE_TOKEN_INVALID = 4003;
    public static final int FACEBOOK_TOKEN_INVALID = 4004;
    public static final int APPLE_TOKEN_INVALID = 4005;
    public static final int OAUTH2_USER_INFO_ERROR = 4006;
    
    // JWT Token相关错误码 (5000-5099)
    public static final int JWT_TOKEN_INVALID = 5001;
    public static final int JWT_TOKEN_EXPIRED = 5002;
    public static final int JWT_TOKEN_MALFORMED = 5003;
    public static final int REFRESH_TOKEN_INVALID = 5004;
    public static final int REFRESH_TOKEN_EXPIRED = 5005;
    public static final int TOKEN_GENERATION_FAILED = 5006;
    
    // 用户相关错误码 (6000-6099)
    public static final int USER_NOT_FOUND = 6001;
    public static final int USER_ALREADY_EXISTS = 6002;
    public static final int USER_CREATION_FAILED = 6003;
    public static final int USER_UPDATE_FAILED = 6004;
    public static final int USER_DELETION_FAILED = 6005;
    public static final int INSUFFICIENT_PERMISSIONS = 6006;
    
    // 业务逻辑相关错误码 (7000-7999)
    public static final int BUSINESS_LOGIC_ERROR = 7001;
    public static final int DATA_VALIDATION_ERROR = 7002;
    public static final int RESOURCE_NOT_FOUND = 7003;
    public static final int RESOURCE_CONFLICT = 7004;
    public static final int OPERATION_NOT_ALLOWED = 7005;
    
    // 外部服务相关错误码 (8000-8999)
    public static final int EXTERNAL_SERVICE_ERROR = 8001;
    public static final int NETWORK_ERROR = 8002;
    public static final int TIMEOUT_ERROR = 8003;
    public static final int SERVICE_UNAVAILABLE = 8004;
    
    // 数据库相关错误码 (9000-9099)
    public static final int DATABASE_ERROR = 9001;
    public static final int DATABASE_CONNECTION_ERROR = 9002;
    public static final int DATA_INTEGRITY_ERROR = 9003;
    public static final int TRANSACTION_ERROR = 9004;
    
    // 私有构造函数，防止实例化
    private ErrorCode() {
        throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
    }
}
